<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="../../common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>用户列表</title>
<link type="text/css" rel="stylesheet" href="${css_ctx }/main_style.css" />
<script type="text/javascript" src="${ctx }/common/js/proving.js"></script>
<script type="text/javascript" language="javascript">
 function submitMyFrom(path){
  document.getElementById('form1').action=path;
  document.getElementById('form1').submit();
 }
</script>
</head>

<body class="content_bg1">

<!-- 标题-->	
<div class="content_tittle">
<c:if test="${!empty content_tittle}">
	${content_tittle}
	<c:remove var="content_tittle" scope="session"/>
</c:if>
</div>
<!--  标题  end-->	

<!-- 提示信息 -->	
<c:if test="${!empty msg}">
	<div class="mag">提示信息：${msg}</div>
	<c:remove var="msg" scope="session"/>
</c:if>
<!-- 提示信息  end-->	

<div class="list_top">
<div class="right">
	<a href="${ctx }/users?cmd=adding_che">新增</a>
</div>

<!-- 查询导出 -->
<form method="post" id="form1" name="form1">
	系统用户模糊查询 &nbsp;|&nbsp;用户名:<input type="text" name="uname" value="${uname }"/> &nbsp;&nbsp;车&nbsp;站:
	<select name="tid">
		<c:if test="${!empty trains}">
			<c:forEach items="${trains}" var="train">
				<option value="${train.tid }" <c:if test="${train.tid eq tid }"> selected="selected"</c:if>>${train.tname }</option>
			</c:forEach>
		</c:if>
	</select>&nbsp;&nbsp;
	组&nbsp;别:
	<select name="urole">
	    <option value="1000" <c:if test="${urole eq '1000' }"> selected="selected"</c:if>>-全部人员-</option>
		<option value="4" <c:if test="${urole eq '4' }"> selected="selected"</c:if>>公共用户</option>
		<option value="5" <c:if test="${urole eq '5' }"> selected="selected"</c:if>>学习用户</option>
	</select>&nbsp;&nbsp;&nbsp;
	<input type="button" value="开始查询" class="btn1_mouseout" onmouseover="this.className='btn1_mouseover'" onmouseout="this.className='btn1_mouseout'" onclick="submitMyFrom('${ctx }/users?cmd=search')"/>&nbsp;&nbsp;&nbsp;
	<input type="button" value="Excel导出查询结果" class="btn1_mouseout" onmouseover="this.className='btn1_mouseover'" onmouseout="this.className='btn1_mouseout'" onclick="submitMyFrom('${ctx }/users?cmd=export')"/>&nbsp;&nbsp;&nbsp;
</form>
<!-- 查询导出  end-->
</div>

<table width="100%" border="0" cellpadding="0" cellspacing="1" class="list_tab">
	<tr>
		<td>
			<strong>编号</strong>
		</td>
		<td>
			<strong>登陆账号</strong>
		</td>
		<td>
			<strong>所属车站</strong>
		</td>
		<td>
			<strong>真实姓名</strong>
		</td>
		<td>
			<strong>用户角色</strong>
		</td>
		<td>
			<strong>学习情况</strong>
		</td>
		<td>
			<strong>明细</strong>
		</td>
	</tr>

	<c:if test="${!empty pm.datas}">
		<c:forEach items="${pm.datas}" var="user" varStatus="status">
			<tr>
				<td>
					[${status.count}]
				</td>
				<td style="text-align:left">
					&nbsp;<img src="${img_ctx}/people.gif" height="20px" width="20px" />&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${ctx }/users?cmd=update_che&uid=${user.uid}">${user.uname}</a>
				</td>
				<td>
					${user.tname}
				</td>
				<td>
					${user.uface}
				</td>
				<td>
                    <c:if test="${'4' eq user.urole}"><font color="blue">车站组</font></c:if>
                    <c:if test="${'5' eq user.urole}"><font color="#9E5254">学习用户</font>[${user.wname }]</c:if>
				</td>	
				<td>
					<c:choose>
					 <c:when test="${'5' eq user.urole}">${user.readnum}</c:when>
					 <c:otherwise>无需阅读</c:otherwise>
					</c:choose>
				</td>							
				<td>
				   
				    <img src="${img_ctx }/114.gif" width="14" height="14" />&nbsp;<a href="${ctx }/users?cmd=update_che&uid=${user.uid}">修改</a>
					&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;  
					<img src="${img_ctx }/083.gif" width="14" height="14" />&nbsp;<a href="${ctx }/users?cmd=delete_che&uid=${user.uid}" onclick = 'return del();'>删除</a>
				   	&nbsp;
				</td>
			</tr>
		</c:forEach>
	</c:if>
	<c:if test="${empty pm.datas}">
		<tr>
			<td colspan="7">
				没有找到相应的记录
			</td>
		</tr>
	</c:if>

</table>

<div class="pages">
	<pg:pager url="${ctx}/users" items="${pm.total}"
		export="currentPageNumber=pageNumber" maxPageItems="10"
		maxIndexPages="10">
		<pg:first>
			<a href="${pageUrl}}&cmd=list_che">首页</a>&nbsp;&nbsp;
		</pg:first>  
                                         [第${currentPageNumber}页]&nbsp;/&nbsp;[共${pm.total}条记录]&nbsp;&nbsp;
                                        <pg:prev>
			<a href="${pageUrl }&cmd=list_che">上一页</a>&nbsp;&nbsp;
		</pg:prev>
		<pg:pages>
			<c:choose>
				<c:when test="${currentPageNumber eq pageNumber}">
					<font color="red">${pageNumber }</font>&nbsp;&nbsp;
				</c:when>
				<c:otherwise>
					<a href="${pageUrl }&cmd=list_che">${pageNumber }</a>&nbsp;&nbsp;&
				</c:otherwise>
			</c:choose>
		</pg:pages>
		<pg:next>
			<a href="${pageUrl }&cmd=list_che">下一页</a>&nbsp;&nbsp;
		</pg:next>
		<pg:last>
			<a href="${pageUrl }&cmd=list_che">尾页</a>&nbsp;&nbsp;
		</pg:last>
	</pg:pager>
</div>
<%@ include file="../../common/footer.jsp"%>
</body>
</html>
